<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['系统配置','厂区配置[程序]']" icon="fa fa-cog" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span><h2>厂区配置[程序]</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn">
								<!-- <div class="top_module">
									<span class="module_text">所属公司</span>
									<sa-company-tree companyTreeId="companyTree" (companySelected)="companySelected($event)"></sa-company-tree>
								</div>
								<button class="btn btn-primary" (click)="table_search()" style="margin-left: 8px;">查询</button> -->
								<button  type="button"  class="btn btn-primary" (click)="addFactoryConfig(factoryConfigModal)">添加配置</button>
							</div>
							<div class="right top-search">
								<input type="text" [(ngModel)]="searchKey" (change)="table_search()" class="search-input" placeholder="编辑人/公司名称/任务名称">
								<span class="top-search-box">
							        <button class="top-search-btn" type="button" (click)="table_search()"> <i class="fa fa-search"></i></button>
							    </span>
							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table" style="table-layout:fixed; word-break:break-all; word-wrap:break-all;">
								<thead>
									<tr>
										<th>任务名称</th>
										<th style="width:35%;">公司名称</th>
										<th>类型</th>
										<th>编辑人</th>
										<th>编辑时间</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData" >
										<td style="white-space: normal;">{{row.jobName}}</td>
										<td style="white-space: normal;">{{row.companyName}}</td>
										<td style="white-space: normal;">{{row.typeName}}</td>
										<!-- <td>
											<span *ngIf="row.type == 1">重置传感器状态</span>
											<span *ngIf="row.type == 2">Matlab重量算法</span>
											<span *ngIf="row.type == 3">传感器检测</span>
											<span *ngIf="row.type == 4">GPS检测</span>
										</td> -->
										<td style="white-space: normal;">{{row.updateUser}}</td>
										<td style="white-space: normal;">{{row.updateTime}}</td>
										<td>
											<button type="button" (click)="editConfig(row, factoryConfigModal)">编辑</button>
											<button type="button" (click)="delConfig(row)">删除</button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount"
								[rows]="pageSize"
								[currentPage]="curPage - 1"
								(onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
	<!--系数设置    弹窗start-->
    <section bsModal #factoryConfigModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" (click)="closeFactoryConfig(factoryConfigModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">厂区配置</h4>
                </div>
                <form id="factoryConfigForm"  class="form-horizontal" role="form" novalidate="novalidate" [saBootstrapValidator]="validatorOptions">
					<div class="modal-body">
						<div class="row form-horizontal">
							<div class="form-group col-xs-12">
								<label class="control-label col-xs-2">任务名称<sup>*</sup></label>
								<div class="col-xs-10" >
									<input class="form-control" name="jobName"  [(ngModel)]='factoryForm.jobName' placeholder="任务名称"/>
								</div>
							</div>
							<div class="form-group col-xs-12">
								<label class="control-label col-xs-2">类型ID<sup>*</sup></label>
								<div class="col-xs-10" >
									<input class="form-control" name="type"  [(ngModel)]='factoryForm.type' placeholder="类型ID" [disabled]="factoryForm.id?true:false"/>
								</div>
							</div>
							<div class="form-group col-xs-12">
								<label class="control-label col-xs-2">类型名称<sup>*</sup></label>
								<div class="col-xs-10" >
									<input class="form-control" name="typeName"  [(ngModel)]='factoryForm.typeName' placeholder="类型名称"/>
								</div>
							</div>
							<!-- <div class="form-group col-xs-12">
								<label class="control-label col-sm-2 no-padding-right">类型<sup>*</sup></label>
								<div class="col-sm-10">
									<div class="clearfix fix_select2">
										<select style="width:100%" class="form-control" name="type" [(ngModel)]="factoryForm.type">
											<option value="1">重置传感器状态</option>
											<option value="2">Matlab重量算法</option>
											<option value="3">传感器检测</option>
											<option value="4">GPS检测</option>
										</select>
									</div>
								</div>
							</div> -->
							<div class="form-group col-xs-12">
								<label class="control-label col-xs-2">公司名称<sup>*</sup></label>
								<div class="col-xs-10">
									<sa-company-tree-checkbox wrap="html" [threeState]="threeStateText" [opened]="false" companyTreeId="companyTreeFrom" [Height]="32" [companyValue]="companyArrays" (companySelected)="addCompanySelected($event)"></sa-company-tree-checkbox>
								</div>
							</div>
						</div>
					</div>
				</form>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" (click)="closeFactoryConfig(factoryConfigModal)">取消</button>
                    <button type="button" class="btn btn-primary" (click)="submitCoefConfig(factoryConfigModal)">提交</button>
                </div>
            </div>
        </div>
    </section>
    <!--系数设置    弹窗end-->
</div>
